"""
    菜品查询页面层
"""
from time import sleep

from selenium.webdriver.common.by import By

from base.base_page import BasePage


class PageDishQuery(BasePage):
    # 实列化属性
    def __init__(self):
        # 初始化父类方法
        super().__init__()
        # 菜品管理按钮
        self.dish_manager_btn = (By.XPATH, "//span[contains(text(),'菜品管理')]")
        # 输入菜品名称
        self.dish_name = (By.CSS_SELECTOR, "input[placeholder='请填写菜品名称']")
        # 点击查询按钮
        self.query_btn = (By.XPATH, "//span[contains(text(),'查询')]")

    # 查询菜品业务方法
    def page_dish_query(self):
        # 点击菜品管理，转到菜品管理页面
        self.base_click(self.dish_manager_btn)
        # 输入菜品名称
        sleep(1)
        self.base_input_text(self.dish_name,"广油拉面")
        # 点击查询
        self.base_click(self.query_btn)


